package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.Admin;
import service.IAdminService;
import service.impl.AdminServiceImpl;

@Controller
@RequestMapping("/Admin")
public class AdminController {

    @Autowired
    private IAdminService adminService = new AdminServiceImpl();

    @GetMapping("/login")
    @ResponseBody
    public Admin login(@RequestParam(name = "name") String name,
                       @RequestParam(name = "pass") String pass){
        return adminService.login(name, pass);
    }
}
